package escenario;

public class CollisionDetector implements Runnable {
	private Escenario es;
	
	public CollisionDetector (Escenario es){
		setEs(es);
	}
	
//	private static double truncate(double x){
//	    long y=(long)(x*100);
//	    return (double)y/100;
//	}
	
	public Escenario getEs() {
		return es;
	}

	public void setEs(Escenario es) {
		this.es = es;
	}
	
//	public void printPosAbsEsc(){
//		System.out.println("Valores Absolutos:\n XAbs:" + truncate(this.getEs().getPosEnemigo(0).getX()) + 
//				"   YAbs:" + truncate(this.getEs().getPosEnemigo(0).getY()) + "   ZAbs:" + 
//				truncate(this.getEs().getPosEnemigo(0).getZ()));	
//	}
		
	@Override
	public void run() {
		// TODO Auto-generated method stub
			
		while(true){
//			for(int i=0; i<this.getEs().getSizeArrayPosEnemigos(); i++){
//				System.out.print(("ID:" + truncate(this.getEs().getPosEnemigo(i).getId()) + " X:"
//						+ truncate(this.getEs().getPosEnemigo(i).getX()) + " Y:" 
//						+ truncate(this.getEs().getPosEnemigo(i).getY()) + " Z:"
//						+ truncate(this.getEs().getPosEnemigo(i).getZ()) + "        "));
//			}
			
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.getEs().calculoColisionTotal();
		}
	}
	
	
}
